package org.jetnuke.modules.pictures;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.jforum.dao.ThemeDAO;

import org.apache.velocity.VelocityContext;
import org.jetnuke.common.ActionForward;
import org.jetnuke.common.IAction;
import org.jetnuke.common.IAdminInfo;
import org.jetnuke.common.IModuleInfo;
import org.jetnuke.common.IUserInfo;
import org.jetnuke.dao.DataAccessDriver;
import org.jetnuke.dao.PictureUserSettingsDAO;
import org.jetnuke.entities.PictureUserSettings;

public class ChooseTheme implements IAction {

	public ActionForward exec(HttpServletRequest request,
			HttpServletResponse response, VelocityContext vc, IModuleInfo info,
			String op, IUserInfo ui, IAdminInfo ai) throws Exception {
		ThemeDAO tm=net.jforum.dao.DataAccessDriver.getInstance().newThemeDAO();
		vc.put("styles", tm.selectAll());
		PictureUserSettingsDAO busm=DataAccessDriver.getInst().newPictureUserSettingsDAO();
		PictureUserSettings bus=busm.retrieveByPk(ui.getID());
		vc.put("settings",bus);
		return new ActionForward(op,info);
	}

}
